{include file="public/head" /}
  
  <body>
    <div class="x-body">
        <form class="layui-form" style="margin-left: 80px;" method="post" action="#">
            <div class="layui-form-item" >
                <label for="username" class="layui-form-label">
                    <span class="x-red">*</span>所属小区:
                </label>
                <div class="layui-input-inline" style="width: 240px;">
                    <input type="text" required="" readonly value="{$roominfo.community_name}"
                    autocomplete="off" class="layui-input"  >
                    <input type="hidden" name="id" value="{$roominfo.id}"/>
                </div>
            </div>    
            <div class="layui-form-item" >
                <label for="username" class="layui-form-label">
                    <span class="x-red">*</span>房屋地址:
                </label>
                <div class="layui-input-inline" style="width: 240px;">
                    <input type="text" required="" readonly value="{$roominfo.group}-{$roominfo.building}-{$roominfo.unit}-{$roominfo.room}"
                    autocomplete="off" class="layui-input"  >
                   
                </div>
            </div>    
            <div class="layui-form-item" >
                <label for="username" class="layui-form-label">
                    <span class="x-red">*</span>房屋面积:
                </label>
                <div class="layui-input-inline" style="width: 240px;">
                    <input type="text" required="" readonly value="{$roominfo.area}"
                    autocomplete="off" class="layui-input"  >
                   
                </div>
            </div>  
            <div class="layui-form-item" >
                <label for="cost_type" class="layui-form-label">
                    <span class="x-red">*</span>费用类型:
                </label>
                <div class="layui-input-inline" style="width: 240px;">
					<select  lay-verify="required" id="cost_type" name="cost_type">
						<option value="">选择费用类型</option>
					  {foreach $type as $typ}
						<option value="{$typ.type}">{$typ.type}</option>
					  {/foreach}
					</select>
				</div>
            </div>   
            <div class="layui-form-item" >
                <label for="price" class="layui-form-label">
                    <span class="x-red">*</span>费用单价:
                </label>
                <div class="layui-input-inline" style="width: 240px;">
					<input type="text" required="" 
                    autocomplete="off" class="layui-input" name="price" >
				</div>
            </div>
               
            <div class="layui-form-item" >
                <label for="acct_period" class="layui-form-label">
                    <span class="x-red">*</span>账期:
                </label>
                <div class="layui-input-inline" style="width: 240px;">
					<input type="text" required="" 
                    autocomplete="off" class="layui-input" name="acct_period" >
				</div>
            </div> 
            <div class="layui-form-item">
                <label for="release_day" class="layui-form-label">
                    <span class="x-red">*</span>账单出账日期:
                </label>
                <div class="layui-input-inline">
                        <input class="layui-input" placeholder="开始日期" name="release_day" id="start" style="width: 240px;">
                </div>
            </div>
            <div class="layui-form-item">
                <label for="deadline" class="layui-form-label">
                    <span class="x-red">*</span>缴费截止日期:
                </label>
                <div class="layui-input-inline">
                        <input class="layui-input" placeholder="截止日期" name="deadline" id="end" style="width: 240px;">
                </div>
            </div>
            <div class="layui-form-item">
                
				<button  class="layui-btn" lay-filter="add" lay-submit="">
                    添加账单
                </button>
            </div>
      </form>
    </div>
    <script>
        layui.use('laydate', function(){
            var laydate = layui.laydate;
            
            //执行一个laydate实例
            laydate.render({
            elem: '#start' //指定元素
            ,format: 'yyyyMMdd'
            });

            //执行一个laydate实例
            laydate.render({
            elem: '#end' //指定元素
            ,format: 'yyyyMMdd'
            });
        });
        
    </script>
    <script>
		function addbill(){
			var form = layui.form
			var t= document.getElementById("cost_type").value;
			
			if(t==""){
				alert('请选择账单的费用类型');
			}else{
				var url = "{:url('admin/Bill/getbillmsg')}";
				$.post(url, {cost_type: t}, function(data) {
					//console.log(data);
					var num= document.getElementById("num").value;
					console.log(parseInt(num)+1);
					document.getElementById("num").value=parseInt(num)+1;
					$(data).appendTo(".yzl")
					
				})
				form.render();
			}
			
			
		}
        
    </script>
    <script>var _hmt = _hmt || []; (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();</script>
  </body>

</html>